<?php

class Solution
{
	private $Id;
	private $IdChallenge;
	private $IdAuthor;
	private $Description;
	private $Valid;
	private $Quality;
	private $FilePath;
	private $Date;
	
	public function getId()
	{
		if(!isset($this->Id))
			$this->setId(0);
		return $this->Id;
	}
	public function setId($id)
	{
		$this->Id = $id;
	}
	public function IsPersited()
	{
		return $this->getId() != 0;
	}

	public function getIdChallenge()
	{
		if(!isset($this->IdChallenge))
			$this->setIdChallenge(0);
		return $this->IdChallenge;
	}
	public function setIdChallenge($idChallenge)
	{
		$this->IdChallenge = $idChallenge;
	}
	
	public function getIdAuthor()
	{
		if(!isset($this->IdAuthor))
			$this->setIdAuthor(0);
		return $this->IdAuthor;
	}
	public function setIdAuthor($idAuthor)
	{
		$this->IdAuthor = $idAuthor;
	}
	
	public function getDescription()
	{
		if(!isset($this->Description))
			$this->setDescription('');
		return $this->Description;
	}
	public function setDescription($description)
	{
		$this->Description = $description;
	}
	
	public function getValid()
	{
		if(!isset($this->Valid))
			$this->setValid(null);
		return $this->Valid;
	}
	public function setValid($Valid)
	{
            $this->Valid = is_null($Valid)? null: (bool)$Valid;
	}
	
	public function getQuality()
	{
		if(!isset($this->Quality))
			$this->setQuality(0);
		return $this->Quality;
	}
	public function setQuality($quality)
	{
		$this->Quality = $quality;
	}
	
	public function getFilePath()
	{
		if(!isset($this->FilePath))
			$this->setFilePath('');
		return $this->FilePath;
	}
	public function setFilePath($filePath)
	{
		$this->FilePath = $filePath;
	}
	
	public function getDate()
	{
		if(!isset($this->Date))
			$this->setDate(date("Y-m-d H:i:s"));
		return $this->Date;
	}
	public function setDate($name)
	{
		$this->Date = $name;
	}
}
?>